package KiBeam;

import javax.swing.event.EventListenerList;

import model.listener.UserListener;

public class DataImpl extends DataPOA {

	protected EventListenerList listeners = new EventListenerList();

	public DataImpl() {
	}

	@Override
	public void send(int userId, int time, float headX, float headY,
			float headZ, float neckX, float neckY, float neckZ, float torsoX,
			float torsoY, float torsoZ, float waistX, float waistY,
			float waistZ, float leftCollarX, float leftCollarY,
			float leftCollarZ, float leftShoulderX, float leftShoulderY,
			float leftShoulderZ, float leftElbowX, float leftElbowY,
			float leftElbowZ, float leftWristX, float leftWristY,
			float leftWristZ, float leftHandX, float leftHandY,
			float leftHandZ, float leftFingertipX, float leftFingertipY,
			float leftFingertipZ, float rightCollarX, float rightCollarY,
			float rightCollarZ, float rightShoulderX, float rightShoulderY,
			float rightShoulderZ, float rightElbowX, float rightElbowY,
			float rightElbowZ, float rightWristX, float rightWristY,
			float rightWristZ, float rightHandX, float rightHandY,
			float rightHandZ, float rightFingertipX, float rightFingertipY,
			float rightFingertipZ, float leftHipX, float leftHipY,
			float leftHipZ, float leftKneeX, float leftKneeY, float leftKneeZ,
			float leftAnkleX, float leftAnkleY, float leftAnkleZ,
			float leftFootX, float leftFootY, float leftFootZ, float rightHipX,
			float rightHipY, float rightHipZ, float rightKneeX,
			float rightKneeY, float rightKneeZ, float rightAnkleX,
			float rightAnkleY, float rightAnkleZ, float rightFootX,
			float rightFootY, float rightFootZ) {

	}

	public void addListener(UserListener listener) {
		this.listeners.add(UserListener.class, listener);
	}

	public void removeListener(UserListener listener) {
		this.listeners.remove(UserListener.class, listener);
	}


	
	@Override
	public void lostUserEvent(int userId) {
		for(UserListener l : listeners.getListeners(UserListener.class)){
			l.lostUser(userId, java.lang.System.currentTimeMillis());
		}
	}

	@Override
	public void newUserEvent(int userId) {
		for(UserListener l : listeners.getListeners(UserListener.class)){
			l.newUser(userId, java.lang.System.currentTimeMillis());
		}
	}

}
